package org.carl.base.dingtalk.bot.model.link;


import cn.hutool.json.JSONUtil;
import lombok.Getter;
import org.carl.base.dingtalk.bot.enums.MsgTypeEnum;
import org.carl.base.dingtalk.bot.model.MsgModel;

/**
 * @author Carl
 */
@Getter
public class LinkMsgModel extends MsgModel {
    private LinkMsgModel() {
        msgtype = MsgTypeEnum.link;
    }

    public static LinkMsgModel link(LinkModel link) {
        LinkMsgModel textMsgModel = new LinkMsgModel();
        textMsgModel.link = link;
        return textMsgModel;
    }

    private LinkModel link;

    @Override
    public String toString() {
        return JSONUtil.toJsonStr(this);
    }
}
